{% extends 'base.html' %}

{% block title %}详情-{% endblock %}
{% block head %}
<link type= "text/css" rel="stylesheet" href=r"D:\project\zlktqa\static\css\detail.css" >
{% endblock %}

{% block main %}
    <h3 class="page-title">{{ question.title }}</h3>
    <p class="question-info">
        <span>作者：{{ question.author.username }}</span>
        <span>时间：{{ question.create_time }}</span>
    </p>
    <hr>
    <p class="question-content">{{ question.content }}</p>
    <hr>
    <h4>评论：({{question.answers|length}})</h4>
    <form action="{{url_for('add_answer')}}" method="post">
        <div class="form-group">
            <input name="answer_content" type="text" class="form-control" placeholder="请填写评论">
            <input type="hidden" name="question_id" value="{{question.id}}">
        </div>
        <div class="form-group" style="text-align: right;">
            <button class="btn btn-primary">立即评论</button>
        </div>
    </form>
<ul class="answer-list">
    {% for answer in question.answers %}
    <li>
         <div class="user-info">
            <img class = "logo" src="../static/images/logo.jpg" width="40px" height="40px">
            <span class="usernaem">{{answer.author.username}}</span>
            <span class="create-time">{{answer.create_time}}</span>
         </div>
             <p class="comment-content">{{ answer.content }}</p>
    </li>
    {% endfor %}
</ul>
{% endblock %}